//-----------------------------------------------------------------------
//<copyright file="ThanhToanBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class ThanhToanBO : BaseBO
	{
		// Interface Instant Object
		private readonly IThanhToanDAO thanhtoanInterfaceObject = null;

		// Constructor
		public ThanhToanBO()
		{
			thanhtoanInterfaceObject = new DAL.ServiceFactory<IThanhToanDAO>().CurrentDAL;
		}

		#region ThanhToan

		/// <summary>
		///
		/// </summary>
		/// <param name="thanhtoan"></param>
		public ThanhToan CreateThanhToan(ThanhToan thanhtoan)
		{
			try
			{
				return thanhtoanInterfaceObject.CreateThanhToan(thanhtoan);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreateThanhToan Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="thanhtoan"></param>
		public void UpdateThanhToan(ThanhToan thanhtoan)
		{
			try
			{
				thanhtoanInterfaceObject.UpdateThanhToan(thanhtoan);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdateThanhToanException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="thanhtoan"></param>
		public void DeleteThanhToan(ThanhToan thanhtoan)
		{
			try
			{
				thanhtoanInterfaceObject.DeleteThanhToan(thanhtoan);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeleteThanhToanException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public ThanhToans GetAllThanhToan()
		{
			try
			{
				return thanhtoanInterfaceObject.GetAllThanhToan();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllThanhToan Exception", ex);
			}
		}

        /// <summary>
        ///
        /// </summary>
        public ThanhToans GetAllThanhToanBySoPX(string soPX)
        {
            try
            {
                return thanhtoanInterfaceObject.GetAllThanhToanBySoPX(soPX);
            }
            catch (Exception ex)
            {
                throw BusinessException.GetException("Business Access GetAllThanhToan Exception", ex);
            }
        }

		/// <summary>
		///
		/// </summary>
		/// <param name="maTT"></param>
		public ThanhToan GetThanhToanByID(string maTT)
		{
			try
			{
				return thanhtoanInterfaceObject.GetThanhToanByID(maTT);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetThanhToanBy ID Exception", ex);
			}
		}

		#endregion
	}
}
